<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性 computed</title>
</head>
<body>
    <div id="app">
        姓: <input type="text" name="firstname" id="firstname" v-model="firstname">
        名: <input type="text" name="lastname" id="lastname" v-model="lastname">
        全名：{{allName}}
    </div>
</body>
<script src="vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            firstname: '吴',
            lastname: '大军'
        },
        computed: {
            allName: function(){
                return this.firstname + this.lastname;
            }
        }
    })
</script>
</html>